package com.travelsmart.client.apresentacao.view.subview;



import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.travelsmart.client.apresentacao.controller.Observer;
import com.travelsmart.client.apresentacao.i18n.I18nMessages;
import com.travelsmart.client.apresentacao.view.BaseView;
import com.travelsmart.client.apresentacao.widget.FormDate;

import com.travelsmart.client.bean.to.FilterPesquisaHotel;


public class ViewInfoHotel extends BaseView implements Observer<FilterPesquisaHotel>{
	private final VerticalPanel vPanelViewInfoHotel = new VerticalPanel();  
	public ViewInfoHotel(HTML nome) {
		super(nome);
		initWidget(vPanelViewInfoHotel);
	}
	
	public void exec(FilterPesquisaHotel filter){
		vPanelViewInfoHotel.clear();
		
		HTML html = new HTML(I18nMessages.INSTANCE.filter_pesquisa(filter.getLocal(), 
				FormDate.dateFormat.format(filter.getEntrada()), 
				FormDate.dateFormat.format(filter.getSaida()), 
				filter.getFaixaValor(), 
				filter.getNumeroEstrela(), 
				filter.getListQuarto().size() ));
		vPanelViewInfoHotel.add(html);
	}
	
	@Override
	public void update(FilterPesquisaHotel filter) {
			exec(filter);
	}
	
}